package com.wmm.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.wmm.domain.Dept;
import com.wmm.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/dept")
public class DeptController {

    @Autowired
    private DeptService deptService;

    @RequestMapping("/findDept")
    @ResponseBody
    public List<Dept> findDept(){
        List<Dept> list = deptService.findAll();

        return list;
    }
}
